package com.hbnu;

import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {

        @Insert("insert into tb_user values (#}{id},#{name},#{address})")
        int addUser(User user);

        @Delete("delete from tb_user where id=#{id}")
        int deleteUser(int id);

        @Update("update tb_user set address=#{address} where id=#{id}")
        int deleteUser(User user);

        @Select("select * from tb_user where id=#{id}")
        User getUserById(int id);

        @Select("select * from tb_user")
        List<User> getUserList();

        @Select("select * from tb_user where #{column}=#{value}")
        List<User> findUserByColumn(@Param("column") String column,@Param("value") String value);

    }
